package com.lwlean.test.domain;

import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * Created by lean on 16-12-5.
 */
public class Users {

    public Users() {}

    public Users(Integer id, String name, String password) {
        this.id = id;
        this.name = name;
        this.password = password;
    }

    private Integer id;

    @Size(min = 2,max = 10,message = "姓名长度不能小于2大于10")
    private String name;
    @NotEmpty(message = "密码不能为空")
    private String password;

    @NotEmpty(message = "性别不能为空")
    @Pattern(regexp = "male|female",message = "性别只能为male或者female")
    private String sex;

    private String email;

    private String phone;

    private String introduct;

    @Pattern(regexp = "^[A-Za-z0-9\\+/]+$",message = "语音文件不是base64编码")

    private String speech;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getIntroduct() {
        return introduct;
    }

    public void setIntroduct(String introduct) {
        this.introduct = introduct;
    }

    public String getSpeech() {
        return speech;
    }

    public void setSpeech(String speech) {
        this.speech = speech;
    }

    @Override
    public String toString() {
        return "Users{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", sex='" + sex + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", introduct='" + introduct + '\'' +
                ", speech='" + speech + '\'' +
                '}';
    }
}
